home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00043_Script_TrekNave
< prev
next >
Wrap
Text File
|
1999-03-19
|
2KB
|
61 lines
property spr
property tempoSem, tempoViagem
property estado
property crono,inicio
property x_ini, y_ini, dx, dy
on beginSprite me
set spr = the spriteNum of me
set tempoSem = 180
set tempoViagem = 120
set estado = 0
set crono = the timer + tempoSem / 2 + random(tempoSem)
end
on cleanSprite me
puppetSprite spr, false
set the visibility of sprite spr to true
end
on idleSprite me
global gMustUpdate
if estado = 0 then
if crono > the timer then return
set estado = 1
set crono = tempoViagem / 2 + random(tempoViagem)
set inicio = the timer
set x_ini = -100
set dx = 840
set y_ini = random(580) - 50
set dy = (random(580) - 50) - y_ini
set tmp = random(3) - 1
if tmp = 2 then
set x_ini = x_ini + dx
set dx = - dx
end if
puppetSprite spr,true
set the member of sprite spr to member ¼
(the number of member "TrekNaves" + tmp)
set the loc of sprite spr to point(x_ini,y_ini)
set the visibility of sprite spr to true
else
if (the timer - inicio) > crono then
set estado = 0
set the visibility of sprite spr to false
set crono = the timer + tempoSem / 2 + random(tempoSem)
else
set x = x_ini + dx * (the timer - inicio) / crono
set y = y_ini + dy * (the timer - inicio) / crono
set the loc of sprite spr to point(x,y)
set gMustUpdate = true
end if
end if
end